import request from '@/utils/request'
import { praseStrEmpty } from "@/utils/ruoyi";

// 获取购物车列表
export function listCart(data) {
  return request({
    url: '/ganxin/buycar/list',
    method: 'get',
    params: data
  })
}

//添加物品到购物车
export function addCart(goodsId) {
    return request({
      url: '/ganxin/buycar/add/' + praseStrEmpty(goodsId),
      method: 'get'
    })
  }

//删除购物车
export function delCart(cartId) {
  return request({
    url: '/ganxin/buycar/delete/' + cartId,
    method: 'get'
  })
}
//移除过期物品
export function deleCart() {
    return request({
      url: '/ganxin/buycar/deleteAll',
      method: 'get',
    })
  }

